package com.luhuiguo.cms.client.ui;

import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.layout.AccordionLayout;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.luhuiguo.cms.client.GlobalConstants;
import com.luhuiguo.cms.client.GlobalMessages;
import com.luhuiguo.cms.client.presenter.NavigationPresenter;

@Singleton
public class NavigationView extends ContentPanel implements NavigationPresenter.Display {

    @SuppressWarnings("unused")
    private GlobalConstants constants;

    @SuppressWarnings("unused")
    private GlobalMessages messages;

    @Inject
    public NavigationView(GlobalConstants constants, GlobalMessages messages) {
        super();

        this.constants = constants;
        this.messages = messages;

        this.setBodyBorder(false);
        this.setLayout(new AccordionLayout());
        this.setLayoutOnChange(true);
        this.setHeading(messages.navigation());
    }

    @Override
    public Widget asWidget() {
        return this;
    }

    @Override
    public void addWidget(Widget widget) {
        this.add(widget);

    }

    @Override
    public void removeWidget(Widget widget) {
        this.remove(widget);
    }

    @Override
    public void showWidget(Widget widget) {

    }

}
